using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace Clue_Less_Client
{
    public partial class NewGame : Form
    {
        public int GameID = -1;
        public NewGame()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            int maxPlayer = 0;
            if (int.TryParse(tbPlayers.Text, out maxPlayer) &&
                tbName.Text != "") {
                localhost.MainService ws = new Clue_Less_Client.localhost.MainService();
                GameID = ws.CreateGame(maxPlayer, tbName.Text);
                this.DialogResult = DialogResult.OK;
                Close();
            }
        }
    }
}